#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<unistd.h>

int main(int argc, char const *argv[])
{
    int count = 0;
    while(1){
        int fd1 = open("file1.txt", O_RDONLY | O_CREAT | O_TRUNC, 0644);
        if(fd1 > 0)count++;
        else{
            perror("open()失败");
            break;
        }
    }
    printf("open %d file\n", count);
    return 0;
}
